﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace jtSprite
{
    public class Sprite
    {
        public static List<Sprite> listSprites = new List<Sprite>();
        public static int NewID()
        {
            int maxIndex = 1001;
            for (int i = 0; i < Sprite.listSprites.Count; i++)
            {
                if (maxIndex <= Sprite.listSprites[i].ID)
                {
                    maxIndex = Sprite.listSprites[i].ID + 1;
                }
            }
            return maxIndex;
        }
        public static void Add(Sprite newSprite)
        {
            newSprite.ID = Sprite.NewID();
            listSprites.Add(newSprite);
        }
        public static void Add()
        {
            Sprite newSprite = new Sprite();
            newSprite.ID = Sprite.NewID();
            listSprites.Add(newSprite);
        }
        public static void Remove(Sprite oldSprite)
        {
            listSprites.Remove(oldSprite);
        }
        public static void Remove(int spriteIndex)
        {
            listSprites.RemoveAt(spriteIndex);
        }

        public int ID = 0;
        public int X = 0;
        public int Y = 0;
        public int Width = 16;
        public int Height = 16;
        public string Description = "";
    }
}
